package com.starmark.sys.org.provider.web;


import com.alibaba.fastjson.JSONObject;
import com.starmark.auth.common.util.UserUtil;
import com.starmark.core.framework.response.Response;
import com.starmark.core.framework.response.SuccessResponse;
import com.starmark.core.framework.web.SysCommonBeanDataController;
import com.starmark.sys.org.api.service.IOrgUserApiService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用获取data的相关接口
 *
 * @author starmark
 * <p>
 * 2018年08月13日下午7:21:41
 */
@RestController
@RequestMapping(value = "/sys/org/common")
public class SysOrgCommonController extends SysCommonBeanDataController {


    @Autowired
    private IOrgUserApiService orgUserApiService;

    @PostMapping("updatePwd")
    @ApiOperation(value = "修改用户密码")
    public Response updatePwd(@RequestBody JSONObject jsonObject) {
        orgUserApiService.updatePwd(UserUtil.getUserId(), jsonObject.getString("password"));
        return SuccessResponse.newInstance();
    }

}
